using UnityEngine;

public class solidEncre : MonoBehaviour
{
	public float xDim;

	public float yDim;

	public float DimChanger;

	public void Start()
	{
		DimChanger = 0.5f;
	}

	private void FixedUpdate()
	{
		if (Mathf.Abs(Mathf.Abs(base.gameObject.transform.localScale.x) - Mathf.Abs(base.gameObject.transform.localScale.y)) > 0.1f)
		{
			if (base.gameObject.transform.localScale.x > base.gameObject.transform.localScale.y)
			{
				xDim = base.gameObject.transform.localScale.x - Mathf.Abs(base.gameObject.transform.localScale.x - base.gameObject.transform.localScale.y) / 4f;
				Debug.Log("-X");
			}
			if (base.gameObject.transform.localScale.x < base.gameObject.transform.localScale.y)
			{
				xDim = base.gameObject.transform.localScale.x + Mathf.Abs(base.gameObject.transform.localScale.y - base.gameObject.transform.localScale.x) / 4f;
				Debug.Log("+X");
			}
			if (base.gameObject.transform.localScale.y > base.gameObject.transform.localScale.x)
			{
				yDim = base.gameObject.transform.localScale.y - Mathf.Abs(base.gameObject.transform.localScale.y - base.gameObject.transform.localScale.x) / 4f;
				Debug.Log("-Y");
			}
			if (base.gameObject.transform.localScale.y < base.gameObject.transform.localScale.x)
			{
				yDim = base.gameObject.transform.localScale.y + Mathf.Abs(base.gameObject.transform.localScale.x - base.gameObject.transform.localScale.y) / 4f;
				Debug.Log("+Y");
			}
		}
		else if (xDim > 5f)
		{
			xDim -= DimChanger;
			yDim = xDim;
		}
		base.gameObject.transform.localScale = new Vector3(xDim, yDim, 1f);
	}
}
